package com.yang.springboot.web;

import com.yang.springboot.config.Person;
import com.yang.springboot.config.School;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @author yanwei.yang
 * @date 2021/11/11 16:58
 * @description:
 */
@Controller
public class IndexController {


    @Resource
    private School school;

    @Resource
    private Person person;


    @ResponseBody
    @RequestMapping("say")
    public String say() {
        return "hi springboot" + school.getName() + "," + school.getWebsite();

    }


    @ResponseBody
    @RequestMapping("person")
    public String person() {
        return "person," + person.getName() + "," + person.getAddress() + "," + person.getAge() + "," + person.getSex();
    }
}
